/*
 *  author: lichuang
 *  2010-09-24
 */
#ifndef __CLRS_STUDY_HEAP_H_
#define __CLRS_STUDY_HEAP_H_

#ifdef __cplusplus
extern "C" {
#endif

struct array_t;

/* for max heap */
extern void maxheap_sort(struct array_t *array);
extern void maxheap_sort_norecursion(struct array_t *array);

extern int  maxheap_maximum(const struct array_t *array);
extern int  maxheap_extract_max(struct array_t* array);
extern void maxheap_increase_key(struct array_t *array, int i, int key);
extern void maxheap_insert(struct array_t *array, int key);

#ifdef __cplusplus
};
#endif
#endif  //  __CLRS_STUDY_HEAP_H_
